import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import styleImport, { VantResolve } from 'vite-plugin-style-import';
import { resolve } from "path";

export default ({ mode }) => {

  const env = loadEnv(mode, process.cwd());
  return defineConfig({
    plugins: [
      vue(),
      styleImport({
        resolves: [VantResolve()],
      }),
    ],
    resolve: {
      alias: {
        "@": resolve(__dirname, "./src")
      }
    },
    server: {
      open: true,
      host: '0.0.0.0'
    },
      css: {
        preprocessorOptions: {
          scss: {
            additionalData: '@import "@/styles/public/index.scss";'
          }
        }
      }
    })
}
